package com.example.apiclientsdk.core;


import com.example.apiclientsdk.util.HttpUtils;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

@Slf4j
public class ApiClient extends AbstractApiClient{

    //网关地址
    public static final String GATEWAY_HOST = "http://localhost:8123";

    public ApiClient(String accessKey, String secretKey){
        super(accessKey, secretKey);
    }

    public String getName(String jsonBody){
        Map<String, String> headers = buildHeaders();
        //发送请求
        String result = HttpUtils.doGet(GATEWAY_HOST + "/api/name", null, headers);
        if(result != null){
            return result;
        }else {
            log.error("结果为空");
        }
        return null;
    }




}
